<!DOCTYPE html>
<html>
<head lang="en">
  <meta charset="UTF-8">
  <title>农村房地一体网络公示平台</title>
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no">
  <meta name="format-detection" content="telephone=no">
  <meta name="renderer" content="webkit">
  <meta http-equiv="Cache-Control" content="no-siteapp" />
  <!--<link rel="alternate icon" type="image/png" href="assets/i/favicon.png">-->
  <link rel="stylesheet" href="assets/css/amazeui.min.css"/>
  <style>
    .header {
      text-align: center;
    }
    .header h1 {
      font-size: 200%;
      color: #333;
      margin-top: 30px;
    }
    .header p {
      font-size: 14px;
    }
    .am-header-default .am-header-title{
      margin: 0 0;
    }
    .login-title{
      line-height: 3;
      margin-top: 50px;
      text-align: center;
    }
    .am-form-group .am-form-label{
      text-align: right;
    }
  </style>
  <script src="js/axios.min.js"></script>
  <script src="config.js"></script>
  <script src="js/jquery-3.4.1.js"></script>

</head>
<body>

<header data-am-widget="header" class="am-header am-header-default">
  <div class="am-header-left am-header-nav">
    <a href="#left-link" class="">
      <i class="am-header-icon am-icon-home"></i>
    </a>
  </div>
  <h1 class="am-header-title">
    <a href="#title-link">农村房地一体网络公示平台</a>
  </h1>
</header>
<div class="am-g">
  <div class="col-lg-6 col-md-8 col-sm-centered">
    <h2 class="login-title">登录</h2>
    <hr>
    <form class="am-form am-form-horizontal">
      <div class="am-form-group">
        <label for="hzxm" class="col-sm-3 am-form-label">姓名</label>
        <div class="col-sm-9">
          <input type="text" id="hzxm" placeholder="请输入户主姓名" required data-validation-message="姓名不符合规范噢"/>
        </div>
      </div>
      <div class="am-form-group">
        <label for="sfzhm" class="col-sm-3 am-form-label">身份证号</label>
        <div class="col-sm-9">
          <input type="text" id="sfzhm" placeholder="请输入户主身份证号码" pattern="^\d{18}$" maxlength="18" required data-validation-message="身份证号不符合规范噢"/>
        </div>
      </div>
      <div class="am-form-group">
        <div class="col-sm-offset-3 col-sm-9">
          <button  type="button" class="am-btn am-btn-default"  style="width: 100%" onclick="login()" >登陆</button>
        </div>
      </div>
    </form>
    <hr>
  </div>
</div>

<footer data-am-widget="footer" class="am-footer am-footer-default" data-am-footer="{  }">
  <div class="am-footer-miscs ">
    <p>
      <a href="#" title="诺亚方舟" target="_blank"></a>Powered by 四川省川核测绘地理信息有限公司</p>
  </div>
</footer>

<script>
  function login() {
      var url = config.loginUrl;
      let hzxm = $("#hzxm").val();
      let sfzhm = $("#sfzhm").val();
      var req = {
          hzxm : hzxm,
          sfzhm : sfzhm
      }
      axios({
          method:'get',
          url:url,
          params: req,
          timeout: 5000
      })
          .then(function(response) {
              if(response.status == 200){
                  var data = response.data;
                  if(data.status ==1){
                      alert(data.msg);
                  }else{
                      location.href="one.html?userInfo="+JSON.stringify(data.data);
                      return false;
                  }
              }
          })
          .catch(function (error) {
              console.log(error);
          });
  }

</script>
</body>
</html>
